{% if dj_machine_qs %}
<table class="bz_buglist" cellpadding="4" cellspacing="0" width="100%">
<tbody>
  <tr class="bz_buglist_header" align="left">
  <th class="first-child">
  <input type="checkbox" id="ckb_all_id" name="ckb_all" onClick="checkAll('ckb_machine', 'ckb_all_id');"/>
  All</th>
  <th>Hostname</th>
  <th>Status</th>
  <th>Mode</th>
  <th>Build NO.</th>
  <th>HW Config.</th>
  <th>Comment</th>
  <!--
  <th>More Info.</th>
  -->
  </tr>

  {% for m in dj_machine_qs %}

  <tr class="bz_bugitem {% cycle 'bz_row_even' 'bz_row_odd' %} 
             {{dj_ltype}}_mstat_{{m.machine.get_status_display}} 
             start_type_{{dj_start_type}} 
    {% if m.machine.id in dj_dtm_lst %}
             dtm
    {% endif %}
             ">

  <td class="first-child">
    <input type="checkbox" name="ckb_machine" value="{{m.machine.id}}" class="validate[minCheckbox[1]]"/>
    <input type="hidden" name="hid_isai" value="{% if m.autoinst_flag %}1{% else %}0{% endif %}"/>
  </td>
			
  <td>{{m.machine.hostname}}</td>
  <td>{{m.machine.get_status_display}}</td>
  <td>{{m.machine.hwmode.name}}/{{m.machine.hwmode.get_arch_display}}</td>
    {% if m.machine.os_bldno and m.machine.dt_bldno %}
  <td>os: {{m.machine.os_bldno}}<br>dt: {{m.machine.dt_bldno}}</td>
    {% else %}
  <td></td>
    {% endif %}
  <td>{% if m.hwconf.psr_pnumber %}
    pcpu: {{m.hwconf.psr_pnumber}} 
    <br>vcpu: {{m.hwconf.psr_vnumber}}
    <br>clock: {{m.hwconf.psr_ckspeed}} 
    <br>mem: {{m.hwconf.mem_size|cut:"egabytes"}}
      {% endif %}
  </td>
    {% if m.machine.id in dj_dtm_lst %}
  <td>designated</td>
    {% else %}
  <td>&nbsp;</td>
    {% endif %}

  <!--
  <td><a id="item_{{m.machine.id}}" onMouseOver="showMessage('{{m.machine.id}}')" onMouseOut="hideMessage()">
    more</a></td>
  -->
  </tr>
  {%endfor%}

  <tr><td class="first-child" colspan="7">
    <hr>
  </td></tr>

  <tr><td class="first-child" colspan="7">
    <b><input type="checkbox" name="ckb_isdryrun" value="1"/>&nbsp;Don't update result in Testopia</b>
  </td></tr>

  <tr><td class="first-child" colspan="7">
    <input type="button" name="btn_submitjob" id="btn_submitjob" value="Submit"/>
  </td></tr>
</tbody></table>

  {% for m in dj_machine_qs %}

<div align="left" id="div_{{m.machine.id}}" class="tooltip_msg2" style="display:none">

<table>
  <tr>
    <td align="right">Hostname : </td>
    <td align="left">{{m.machine.hostname}}</td>
  </tr>
  <tr>
    <td align="right">Mac : </td>
    <td align="left">{{m.mac}}</td>
  </tr>
  <tr>
    <td align="right">Owner : </td>
    <td align="left">{{m.machine.owner.email}}</td>
  </tr>
  <tr>
    <td align="right">IP Addr. Type : </td>
    <td align="left">{{m.get_ipaddr_type_display}}</td>
  </tr>
  <tr>
    <td align="right">Group : </td>
    <td align="left">{{m.machine.mgroup.name}}</td>
  </tr>
  <tr>
    <td align="right">Location :</td>
    <td align="left">{{m.location.name}}</td>
  </tr>
  <tr>
    <td align="right">Mode : </td>
    <td align="left">{{m.machine.hwmode.name}}</td>
  </tr>
  <tr>
    <td align="right">HWConf : </td>
    <td align="left">{% if m.hwconf.psr_pnumber %}pcpu: {{m.hwconf.psr_pnumber}} vcpu: {{m.hwconf.psr_vnumber}}({{m.hwconf.psr_ckspeed}}) mem: {{m.hwconf.mem_size}}{% endif %}</td>
  </tr>
  <tr>
    <td align="right">Domain : </td>
    <td align="left">{{m.machine.site.domain}}</td>
  </tr>
  <tr>
    <td align="right">Serial No : </td>
    <td align="left">{{m.serial_no}}</td>
  </tr>
  <tr>
    <td align="right">SP Hostname : </td>
    <td align="left">{{m.sp_hostname}}</td>
  </tr>
  <tr>
    <td align="right">Notif. Emails : </td>
    <td align="left">{{m.machine.notification_email}}</td>
  </tr>
  <tr>
    <td align="right">Comments : </td>
    <td align="left">{{m.comments}}</td>
  </tr>
  </table>

</div>
  {% endfor %}
{% else %}
<p>No machine found</p>
<p></p>
{% endif %}
